#define _CRT_SECURE_NO_WARNINGS 1

#include<stdio.h>
int main()
{
	int a = 0,i = 0;
	int A = 0, B = 0, C = 0, D = 0, E = 0;
	int arr[100] = {0};
	scanf_s("%d", &a);
	for (i = 0; i < a; i++)
	{
		scanf_s("%d", &arr[i]);
	} 
	for (i = 0; i < a; i++)
	{
		switch (arr[i] / 10)
		{
		case 9:
			A++;
			break;
		case 8:
			B++;
			break;
		case 7:
			C++;
			break;
		case 6:
			D++;
			break;
		default:
			E++;
			break;
		}
	}
	printf("A:%d\nB:%d\nC:%d\nD:%d\nE:%d\n", A, B, C, D, E);
	return 0;
}
